//
//  ObserverableData.m
//  V3d_Cocoa
//
//  Created by Y my on 11-3-14.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "ObserverableData.h"


@implementation ObserverableData

- (id)init {
	self = [super init];
	if (self) {
		observers = [[NSMutableSet alloc] initWithCapacity:1];
	}
	return self;
}

- (void)registerObserver:(id <Observer>)observer {
	[observers addObject:observer];
}

- (void)unregisterObserver:(id <Observer>)observer {
	[observers removeObject:observer];
}

- (void)notify {
	for (id <Observer> ob in observers) {
		[ob updateView];
	}
}
@end
